﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Happy.ExtentionMethods;

namespace Happy.Query.Filters
{
    /// <summary>
    /// 筛选器分组。
    /// </summary>
    public sealed class FilterGroup : IFilter
    {
        /// <summary>
        /// 构造方法。
        /// </summary>
        public FilterGroup(Connector connector, IFilter[] filters)
        {
            filters.MustNotEmpty("filters");

            this.Connector = connector;
            this.Filters = filters;
        }

        /// <summary>
        /// 连接器。
        /// </summary>
        public Connector Connector { get; private set; }

        /// <summary>
        /// 子筛选器。
        /// </summary>
        public IFilter[] Filters { get; private set; }

        /// <inheritdoc />
        public void Accept(IFilterVisitor visitor)
        {
            visitor.Visit(this);
        }
    }
}
